
from chaotic import chaotic
from live import join, bottom, top, assign, iota, no_assign

succ = {0: set(),
        1: set([0]),
        2: set([1]),
        3: set([2]),
        4: set([2,3]),
        }

tr = {(1,0): lambda live: assign(live, 'a', ('0', ())),
        (2,1): lambda live: no_assign(live, ('>', (('a',()), ('0',())))),
        (3,2): lambda live: assign(live, 'c', ('b', ())),
        (4,3): lambda live: assign(live, 'b', ('3', ())),
        (4,2): lambda live: assign(live, 'b', ('3', ())),
          }

tr_txt = {(1,0): "a = 0",
          (2,1): "if a > 0",
          (3,2): "c = b",
          (4,3): "b = 3",
          (4,2): "b = 3",
          }

chaotic(succ, 4, set(), join, bottom, tr, tr_txt, "live_prog2.png")

#0
#1     a = 0;
#2     if a > 0
#3          c = b;
#4     b = 3;
